package org.jeecg.modules.ordercommon.service;

import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class OrderPointsService {

    /**
     * 根据积分或者样本数量计算积分
     *
     * @param price
     * @param sampleNum
     * @param direction 方向  1-增加或者2-扣除
     * @return
     */
    public Integer calPoints(Integer price, Integer sampleNum, Integer direction) {
        Integer points = Integer.valueOf(price * 100);
        if (direction == 1) {
            return points;
        } else {
            return -1 * points;
        }
    }




}
